

package com.hazelcast.core;

/**
 * Type of item events.
 */
public enum ItemEventType {
    /**
     * Fired when an item is added.
     */
    ADDED(1),

    /**
     * Fired when an item is removed.
     */
    REMOVED(2);

    private final int type;

    ItemEventType(final int type) {
        this.type = type;
    }

    public static ItemEventType getByType(final int eventType) {
        for (ItemEventType entryEventType : values()) {
            if (entryEventType.type == eventType) {
                return entryEventType;
            }
        }
        return null;
    }

    public int getType() {
        return type;
    }
}
